package com.changgou.oauth.interceptor;

import com.changgou.oauth.util.AdminToken;
import feign.RequestInterceptor;
import feign.RequestTemplate;

public class TokenRequestInterceptor implements RequestInterceptor {
    //feign执行前进行拦截
    @Override
    public void apply(RequestTemplate template) {
        String token = AdminToken.adminToken();
        template.header("Authorization","bearer "+token);
    }
}
